@extends('manage.layout')

@section('content')
    <section class="content-header">
        <h1>
            客户详情
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li><a href="#">Client</a></li>
            <li class="active">Client Details</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title">内容</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body" style="text-align: center">
                        <table class="table table-bordered table-hover">
                            <tr>
                                <td style="width: 30%">公司名称</td>
                                <td >{{ $client->company }}</td>
                            </tr>
                            <tr>
                                <td>第一联系人</td>
                                <td>{{ $client->first_name }}</td>
                            </tr>
                            <tr>
                                <td>第一联系人电话</td>
                                <td>{{ $client->first_phone }}</td>
                            </tr>
                            <tr>
                                <td>第二联系人</td>
                                <td>{{ $client->second_name }}</td>
                            </tr>
                            <tr>
                                <td>第二联系人电话</td>
                                <td>{{ $client->second_phone }}</td>
                            </tr>
                            <tr>
                                <td>行业</td>
                                <td>{{ App\Model\Industry::find($client->industry_id)['name'] }}</td>
                            </tr>
                            <tr>
                                <td>所在地</td>
                                <td>{{ $client->loc }}</td>
                            </tr>
                            <tr>
                                <td>详细地址</td>
                                <td>{{ $client->address }}元</td>
                            </tr>
                            <tr>
                                <td>公司规模</td>
                                <td>
                                    @if($client->scale ==0 )20人以下
                                    @elseif($client->scale ==1)50人以下
                                    @elseif($client->scale ==2)100人以下
                                    @elseif($client->scale ==3)200人以下
                                    @elseif($client->scale ==4)200人以上
                                    @endif
                                </td>
                            </tr>
                            <tr>
                                <td>添加人</td>
                                <td>
                                    @foreach($users as $k=>$v)
                                        @foreach($v['user_detail'] as $d_k=>$d_v)
                                            @if($client->dd_id == $d_v['user_id'])
                                                {{ $d_v['user_name'] }}({{ $v['user_department'] }})
                                            @endif
                                        @endforeach
                                    @endforeach
                                </td>
                            </tr>
                            <tr>
                                <td>状态</td>
                                <td>
                                    @if($client->status ==0 )待观察
                                    @elseif($client->status ==1)跟进中
                                    @elseif($client->status ==2)已成单
                                    @endif
                                </td>
                            </tr>
                            <tr>
                                <td>备注</td>
                                <td>{{ $client->remark }}</td>
                            </tr>
                            <tr>
                                <td>图片</td>
                                <td>
                                    {{--{{ $client->picture }}--}}
                                    <div id="md" class="md-trigger" style="width:100%;height:100px;margin: auto">
                                        @foreach($pic as $k=>$v)
                                            <img layer-src="http://vipyipoint.oss-cn-beijing.aliyuncs.com/{{ $v }}" src="http://vipyipoint.oss-cn-beijing.aliyuncs.com/{{ $v }}" width="100px" height="100px" style="margin-right: 10px">
                                        @endforeach
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </section>
@stop

@section('script')
    <script>
        layer.photos({
            photos: "#md"
            ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
        });
    </script>
@stop